package com.gcxy.jk.shixunyi.utils;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * @version 1.0
 * @Author xujianlun
 * @Date 2022/10/2 10:13
 * @注释 获取当前时间
 */
public class GetNowTime {
    /**
     * 返回一个现在时间
     * @return
     */
    public static LocalDateTime getNowTime(){
        Date now = new Date();
        Instant instant = now.toInstant();
        ZoneId zone = ZoneId.systemDefault();
        LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
        return localDateTime;
    }
}
